#ifndef DMATRIX_HPP
#define DMATRIX_HPP

#include "DArray.hpp"

/* ========================================================
   DMatrix.hpp
   Dynamic matrix class
   define basic operation on matrix

Authour: Ju Liu, Sept 27th 2011
=======================================================*/

class DMatrix
{
  public:
    DMatrix(const int row, const int col);
    ~DMatrix();
    DArray& operator[](const int index);
    const DArray& operator[](const int index) const;
    DMatrix& operator*=(const double rhs);
    DMatrix& operator+=(const DMatrix& rhs);

    int rows() const
    {return mRowsize;}

    int cols() const
    {return mColsize;}

    void print() const;
  private:
    DArray** matrixPtr;
    int mRowsize, mColsize;
};

#endif
